package net.stogi.unicore.beyond.ui.client.taskeditor.taskoutline;

import net.stogi.unicore.beyond.api.model.InputDefinition;

import com.google.gwt.event.shared.GwtEvent;

public class InputDefinitionSelectedEvent extends GwtEvent<InputDefinitionSelectedHandler> {

	public static final GwtEvent.Type<InputDefinitionSelectedHandler> TYPE = new GwtEvent.Type<InputDefinitionSelectedHandler>();

	private InputDefinition inputDefinition;

	public InputDefinitionSelectedEvent(InputDefinition inputDefinition) {
		this.inputDefinition = inputDefinition;
	}

	@SuppressWarnings("unused")
	private InputDefinitionSelectedEvent() {}

	@Override
	public Type<InputDefinitionSelectedHandler> getAssociatedType() {
		return TYPE;
	}

	public InputDefinition getInputDefinition() {
		return inputDefinition;
	}

	public void setInputDefinition(InputDefinition inputDefinition) {
		this.inputDefinition = inputDefinition;
	}

	@Override
	protected void dispatch(InputDefinitionSelectedHandler handler) {
		handler.onInputDefinitionSelected(this);
	}
}
